diag_log text "recording started";
if (!record) then {
  record = true;
} else {
  exit;
};
hint "Starting flight log in 5 seconds";
sleep 4;
hint "Starting flight log in 1 second";
sleep 1;
diag_log text "==start of flight log==";
_inc = 10;
_skip = 0;
diag_log text "FL [";
hint "Position recording started";
while { record } do {
  _pos = getPos player; 
  _hdg = getDir player;
  _v = vehicle player;
  _spd = speed _v;
  // hint format["%1", _pos]; 
  _x = _pos select 0;
  _y = _pos select 1;
  diag_log text format["FL   {skip: %1, x: %2, y: %3, hdg: %4, spd: %5},", _skip, _x, _y, _hdg, _spd];
  sleep _inc; 
  _skip = _skip + _inc;
};
diag_log text "FL ]";
hint "Position recording stopped";
